const express = require('express');
const router = express.Router();
const swiperController = require('../controller/swiperController.js');

//处理图片上传
const multer = require("multer");
const SwiperImg = multer({dest:"./img/Swiper/"});

//获取轮播图列表
router.get('/list',swiperController.GetSwiperList);

//添加轮播图
router.post('',SwiperImg.single('file'),swiperController.AddSwiper);

//修改轮播图
router.put('',SwiperImg.single('file'),swiperController.UpdateSwiper);

//删除轮播图
router.delete('',swiperController.DeleteSwiper)

// 批量删除汽车
router.delete('/BatchDeleteSwiper',swiperController.BatchDeleteSwiper);

//获取后台管理轮播图
router.get('/AdminSwiper',swiperController.GetAdminSwiper);

//获取客户端管理轮播图
router.get('/ClientSwiper',swiperController.GetClientSwiper);

module.exports = router;